import Vue from 'vue'
import Router from 'vue-router'
import Home from '../views/Home.vue'
import Category from '../views/Category.vue'
import Cart from '../views/Cart.vue'
import User from '../views/User.vue'
import Search from '../views/Search.vue'
import SearchList from '../views/SearchList.vue'
Vue.use(Router)
// 重定向路由要看
export default new Router({
  routes: [
    {
      name: 'defaults',
      path: '/',
      redirect: {name: 'Home'}
    },
    {
      name: 'Home',
      path: '/home',
      component: Home
    },
    {
      name: 'Category',
      path: '/category',
      component: Category
    },
    {
      name: 'Cart',
      path: '/cart',
      component: Cart
    },
    {
      name: 'User',
      path: '/user',
      component: User
    },
    {
      name: 'Search',
      path: '/search',
      component: Search
    },
    {
      name: 'SearchList',
      path: '/searchList/:key',
      component: SearchList
    }
  ]
  // linkActiveClass: 'isRed'

})
